Skip to content

test: strengthen tests against PIT mutants (85% → 90% strength)#39

Merged
dfa1 merged 1 commit into
mainfrom
test/kill-mutants
Jun 27, 2026
Merged

test: strengthen tests against PIT mutants (85% → 90% strength)#39
dfa1 merged 1 commit into
mainfrom
test/kill-mutants

Conversation

@dfa1

@dfa1 dfa1 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

What

Mutation analysis (./mvnw -pl zstd -P pitest verify) surfaced surviving mutants in the byte-level I/O streams, context dictionary/prefix paths, size guards, and native-library lookup. This adds behavior-asserting tests that kill them.

Coverage added

  • ZstdStreamTest — flush reaches the sink (sink.size()), close idempotency, unsigned read() value, EOF stays -1 across both read overloads, refill boundaries
  • RefPrefixTest — fluent setters return the same context (chaining contract)
  • NativeLibraryTest — missing-symbol lookup throws UnsatisfiedLinkError
  • ZstdParameterTestlevel() actually applies to the native path (min vs max → strictly smaller frame)
  • ZstdSegmentTest / ZstdErrorTest — decompress dictionary path, native error name as message

Result

Before After
Killed 327 / 406 354 / 406
Test strength 85% 90%
No-coverage 21 12

Remaining survivors are mostly equivalent (native-call wrapper lambda returns). Tests only — no production changes. Reviewed by the project review agent (APPROVE); all Given/When/Then conventions satisfied.

🤖 Generated with Claude Code

Mutation analysis (./mvnw -pl zstd -P pitest verify) surfaced surviving
mutants in the I/O streams, context dictionary/prefix paths, size guards,
and native-library lookup. Add behavior-asserting tests that kill them:

- ZstdStreamTest: flush reaches the sink, close idempotency, unsigned
  read() value, EOF stays -1 across both read overloads, refill boundaries
- RefPrefixTest: fluent setters return the same context (chaining contract)
- NativeLibraryTest: missing-symbol lookup throws
- ZstdParameterTest: level() actually applies to the native path
- ZstdSegmentTest / ZstdErrorTest: decompress dict path, native error name

Killed 327 -> 354 of 406 mutations; test strength 85% -> 90%; no-coverage
21 -> 12. Remaining survivors are mostly equivalent (native-call wrapper
lambda returns). Tests only; no production changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 2689697 into main Jun 27, 2026
1 check passed
@dfa1 dfa1 deleted the test/kill-mutants branch June 27, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant